﻿<UserControl x:Class="UIComposition.Modules.Employee.EmployeesDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:UIComposition.Modules.Employee"
    xmlns:cal="http://www.codeplex.com/CompositeWPF">
    <StackPanel Margin="0,5,0,5">
        <TabControl AutomationProperties.AutomationId="DetailsTabControl" cal:RegionManager.RegionName="{x:Static local:RegionNames.TabRegion}"
        Style="{DynamicResource SimpleTabControl}" Width="Auto" Height="Auto" Margin="0,5,0,0" HorizontalAlignment="Stretch">
            <TabControl.ItemContainerStyle>
                <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource SimpleTabItem}">
                    <Setter Property="Header" Value="{Binding Content.DataContext.HeaderInfo}" />
                </Style>
            </TabControl.ItemContainerStyle>
            <TabItem  Header="General" Style="{DynamicResource SimpleTabItem}" >
                <Grid  DataContext="{Binding SelectedEmployee}"  Width="Auto" Height="Auto">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width=".5*" />
                        <ColumnDefinition Width=".5*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0" Orientation="Vertical">
                        <Label Content="First Name:" HorizontalAlignment="Left" Padding="0,5,5,5" FontWeight="Bold" ></Label>
                        <TextBox AutomationProperties.AutomationId="FirstNameTextBox" Text="{Binding Path=FirstName}" Height="Auto" Width="Auto"  HorizontalAlignment="Stretch" Margin="0,5,100,5" ></TextBox>
                        <Label Content="Phone:" HorizontalAlignment="Left" Padding="0,5,5,5" FontWeight="Bold" ></Label>
                        <TextBox AutomationProperties.AutomationId="PhoneTextBox" Text="{Binding Path=Phone}" Height="Auto" Width="Auto"  HorizontalAlignment="Stretch" Margin="0,5,100,5" ></TextBox>
                    </StackPanel>
                    <StackPanel Grid.Column="1">
                        <Label Content="Last Name:" HorizontalAlignment="Left" Padding="0,5,5,5" FontWeight="Bold" ></Label>
                        <TextBox AutomationProperties.AutomationId="LastNameTextBox" Text="{Binding Path=LastName}" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" Margin="0,5,100,5" ></TextBox>
                        <Label Content="Email:" HorizontalAlignment="Left" Padding="0,5,5,5" FontWeight="Bold" ></Label>
                        <TextBox AutomationProperties.AutomationId="EmailTextBox" Text="{Binding Path=Email}" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" Margin="0,5,100,5" ></TextBox>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Header="Location" Style="{DynamicResource SimpleTabItem}" >
                <StackPanel>
                    <Frame Source="{Binding AddressMapUrl}" Height="210"  NavigationFailed="Frame_NavigationFailed" Navigated="Frame_Navigated"></Frame>
                    <TextBlock Name="ErrorText" Foreground="Red" Visibility="Hidden" Style="{DynamicResource SimpleTextBlock}" ></TextBlock>
                </StackPanel>
            </TabItem>
        </TabControl>
    </StackPanel>
</UserControl>
